#include<stdio.h>
int main(){
	int n,m;
	scanf("%d",&n);
	for(m=1;m<=n;m++){
		int a,b,c,d,x,y;
		scanf("%d%d%d%d",&a,&b,&c,&d);
		x=a*c-b*d;
		y=a*d+b*c;
		printf("%d %d\n",x,y);
	}
}
